Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-wsl

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-wsl

Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24M
decreased by-42.97%
Maintainers
1
Weekly downloads
 
Created

What is is-wsl?

The is-wsl npm package is used to check if the current environment is running inside Windows Subsystem for Linux (WSL). It is a simple utility that can be used in Node.js applications to tailor behavior based on whether the code is executing in WSL or not.

What are is-wsl's main functionalities?

Detecting WSL environment

This feature allows developers to determine if their Node.js code is running inside WSL. The package exports a boolean value that is true if the environment is detected as WSL, and false otherwise. The code sample demonstrates how to use this boolean to conditionally execute code based on the environment.

const isWsl = require('is-wsl');

if (isWsl) {
  console.log('Running inside Windows Subsystem for Linux');
} else {
  console.log('Not running inside WSL');
}

Other packages similar to is-wsl

Keywords

FAQs

Package last updated on 03 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc